package control;

import java.io.File;
import java.util.Scanner;

public class Local {
    public static void main(String[] args) {
        System.out.println("请输入你要找的目录：");
        Scanner scanner = new Scanner(System.in);
        String path=scanner.nextLine();
        File file=new File(path);
        File[] tempList = file.listFiles();
        System.out.println("该目录下对象个数："+tempList.length);
        for (int i = 0; i < tempList.length; i++) {
            if (tempList[i].isFile()) {
                System.out.println("文     件："+tempList[i]);
            }
            if (tempList[i].isDirectory()) {
                System.out.println("文件夹："+tempList[i]);
            }
        }
    }
}
